package com.highcom.service.impl;

import com.highcom.mapper.UserMapper;
import com.highcom.pojo.User;
import com.highcom.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(User user) {
        return userMapper.userLogin(user);
    }

    @Override
    public List<User> findUsers() {
        return userMapper.findUsers();
    }

    @Override
    public void delUserById(int id) {
        userMapper.delUserById(id);
    }

    @Override
    public void delUsersByIds(int[] ids) {
        for (int id : ids) {
            userMapper.delUserById(id);
        }
    }

    @Override
    public User findUserById(int id) {
        return userMapper.FindUserById(id);
    }

    @Override
    public void modifyUser(User user) {
        userMapper.modifyUser(user);
    }

    @Override
    public void addUser(User user) {
        userMapper.addUser(user);
    }

    @Override
    public List<User> findUsersLikeQuery(User user) {
        return userMapper.findUsersLikeQuery(user);
    }
}
